<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script>

description('Test MutationObserver.observe options related to character data');

var observer = new MutationObserver(function() {});
var text = document.createTextNode('0');

observer.observe(text, {characterDataOldValue: true});
text.data = '1';
var records = observer.takeRecords();
shouldBe('records.length', '1');
shouldBeEqualToString('records[0].oldValue', '0');
observer.disconnect();

observer.observe(text, {characterDataOldValue: false});
text.data = '2';
var records = observer.takeRecords();
shouldBe('records.length', '1');
shouldBeNull('records[0].oldValue');
observer.disconnect();

</script>
